package com.guanglan.serviceImpl;

import com.guanglan.entity.SysPermission;
import com.guanglan.entity.SysRole;
import com.guanglan.mapper.SysPermissionMapper;
import com.guanglan.mapper.SysRoleMapper;
import com.guanglan.service.ShiroService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * 作者: 光蓝Comet
 * Date: 2018-06-22 10:58
 * Description: 一句话说明这个类的作用
 * Since 1.0
 */
@Service
public class ShiroServiceImpl implements ShiroService {

    private static final Logger logger = LoggerFactory.getLogger(ShiroServiceImpl.class);

    @Autowired
    private SysRoleMapper sysRoleMapper;

    @Autowired
    private SysPermissionMapper sysPermissionMapper;

    @Override
    public List<SysRole> selectSysRolesByUserName(String userName) {
        return sysRoleMapper.selectSysRolesByUserName(userName);
    }

    @Override
    public List<SysPermission> selectSysPermissionByUserName(String userName) {
        return sysPermissionMapper.selectSysPermissionByUserName(userName);
    }

    @Override
    public List<SysPermission> selectParentMenuByUserName(String userName) {
        return sysPermissionMapper.selectParentMenuByUserName(userName);
    }

    @Override
    public List<SysPermission> selectChildMenuByPid(Long pid) {
        return sysPermissionMapper.selectChildMenuByPid(pid);
    }
}
